package com.hgw.Demo05_MediatorPattern.examples;

/**
 * Data time:2021/12/18 17:43
 * StudentID:2019112118
 * Author:hgw
 * Description: 抽象组件类，充当抽象同事类
 */
public abstract class Component {
    protected Mediator mediator;

    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }

    // 转发调用
    public void changed() {
        mediator.componentChanged(this);
    }

    public abstract void update();
}
